// Used to store that is shared between the functions/chapters of a mission.

//#define __FORCE_TRACE__
//#define __FORCE_DEBUG__
//#define __FORCE_INFO__
#define THIS_FILE "management\fn_getMissionVar.sqf"
#include <tmf_constants.h>
#include <tmf_macros.h>


TRACE_1("Start",_this);
TMFPROFILERSTART;

private ["_key","_default","_instance_id","_result","_variables"];
DEFAULT_PARAM(_instance_id,0,"");
DEFAULT_PARAM(_key,1,"");
DEFAULT_PARAM(_default,2,nil);
_result = _default;
if (_key != "") then {
	_variables = OGETVAR(GVAR(mission_variables),_instance_id,(call CFUNC(hashEmpty)));
	_result = [_variables,_key,_default] call CFUNC(hashGet);
};
TRACE_1("End",_result);
TMFPROFILERSTOP;
_result;
